home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kactivelabel.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-10  |  2.7 KB  |  88 lines

  1. /*  This file is part of the KDE libraries
  2.     Copyright (C) 1999 Waldo Bastian (bastian@kde.org)
  3.  
  4.     This library is free software; you can redistribute it and/or
  5.     modify it under the terms of the GNU Library General Public
  6.     License as published by the Free Software Foundation; version 2
  7.     of the License.
  8.  
  9.     This library is distributed in the hope that it will be useful,
  10.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.     Library General Public License for more details.
  13.  
  14.     You should have received a copy of the GNU Library General Public License
  15.     along with this library; see the file COPYING.LIB.  If not, write to
  16.     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  17.     Boston, MA 02110-1301, USA.
  18. */
  19. #ifndef _KACTIVELABEL_H_
  20. #define _KACTIVELABEL_H_
  21.  
  22. #include <qtextbrowser.h>
  23.  
  24. #include <kdelibs_export.h>
  25.  
  26. // ### inherit KTextBrowser in KDE4
  27.  
  28. class KActiveLabelPrivate;
  29.  /**
  30.   * Label with support for selection and clickable links.
  31.   * openLink() the actions that will be taken when the user
  32.   * clicks on a link.
  33.   *
  34.   * @author Waldo Bastian (bastian@kde.org)
  35.   * @version $Id: kactivelabel.h 465272 2005-09-29 09:47:40Z mueller $
  36.   */
  37. class KDEUI_EXPORT KActiveLabel : public QTextBrowser
  38. {
  39.     Q_OBJECT
  40. public:
  41.     /**
  42.      * Constructor.
  43.      *
  44.      * It connects the "linkClicked(const QString &)" signal to the
  45.      * "openLink(const QString &)" slot. You will need to disconnect
  46.      * this if you want to process linkClicked() yourself.
  47.      */
  48.     KActiveLabel(QWidget * parent, const char * name = 0);
  49.  
  50.     /**
  51.      * Constructor.
  52.      *
  53.      * It connects the "linkClicked(const QString &)" signal to the
  54.      * "openLink(const QString &)" slot. You will need to disconnect
  55.      * this if you want to process linkClicked() yourself.
  56.      */
  57.     KActiveLabel(const QString & text, QWidget * parent, const char * name = 0);
  58.  
  59.     QSize minimumSizeHint() const;
  60.     QSize sizeHint() const;
  61.  
  62. public slots:
  63.     /**
  64.      * Opens @p link in the default browser.
  65.      *
  66.      * If @p link starts with the text "whatsthis:" a QWhatsThis
  67.      * box will appear and then display the rest of the text. The WhatsThis
  68.      * functionality is available since KDE 3.2.
  69.      */
  70.     virtual void openLink(const QString & link);
  71.  
  72. private slots:
  73.     void paletteChanged();
  74.     void setSource( const QString &) { }
  75.  
  76. private:
  77.     void init();
  78. protected:
  79.     virtual void virtual_hook( int id, void* data );
  80.     virtual void focusInEvent( QFocusEvent* fe );
  81.     virtual void focusOutEvent( QFocusEvent* fe );
  82.     virtual void keyPressEvent ( QKeyEvent * e );
  83. private:
  84.     KActiveLabelPrivate *d;
  85. };
  86.  
  87. #endif
  88.